class CreateSpus < ActiveRecord::Migration[5.2]
  def change
    create_table :spus do |t|
      t.string :name, comment: "SPU的名字"
      t.integer :shop_category_id, comment: "所属分类的ID"
      t.boolean :seven_day_back, default: true, comment: "七天免费退换，该字段已作废"
      t.string :title, comment: "SPU的题目，该字段已作废"
      t.integer :shop_id, comment: "所属店铺ID"
      t.integer :brand_id, comment: "所属品牌ID"
      t.integer :sales_volume, default: 0, comment: "销售量"
      t.string :avatar, comment: "SPU图标，用于列表显示"
      t.boolean :genuine_product, default: true
      t.boolean :promotion, default: false
      t.boolean :can_use_coupon, default: false
      t.boolean :handpick, default: false
      t.integer :stock, default: 0
      t.integer :min_stock, default: 0
      t.integer :max_stock, default: 0
      t.integer :state, default: 0
      t.integer :fare_template_id
      t.integer :spu_category_id
      t.string :reason
      t.boolean :published, default: false
      t.text :description


      t.timestamps
    end
  end
end
